.chatBox {
  display: flex;
  flex-direction: column;
  height: 100%;

  .messagesContainer {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #f5f5f5;

    .messageWrapper {
      margin-bottom: 16px;
      display: flex;
      flex-direction: column;

      &.userMessage {
        align-items: flex-end;

        .messageContent {
          flex-direction: row-reverse;
        }

        .messageBubble {
          background-color: #1890ff;
          color: #fff;
          border-radius: 16px 16px 0 16px;
        }
      }

      &.aiMessage {
        align-items: flex-start;

        .messageBubble {
          background-color: #fff;
          border-radius: 16px 16px 16px 0;
        }
      }

      .messageContent {
        display: flex;
        align-items: flex-end;
        max-width: 80%;
      }

      .messageAvatar {
        margin: 0 8px;
      }

      .messageBubble {
        padding: 12px 16px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        word-break: break-word;
      }

      .messageTime {
        font-size: 12px;
        color: #999;
        margin-top: 4px;
        padding: 0 8px;
      }
    }

    .typingIndicator {
      display: flex;
      align-items: center;

      span {
        height: 8px;
        width: 8px;
        margin: 0 2px;
        background-color: #bbb;
        border-radius: 50%;
        display: inline-block;
        animation: typing 1.4s infinite ease-in-out both;

        &:nth-child(1) {
          animation-delay: 0s;
        }

        &:nth-child(2) {
          animation-delay: 0.2s;
        }

        &:nth-child(3) {
          animation-delay: 0.4s;
        }
      }
    }
  }

  .inputContainer {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff;
    border-top: 1px solid #e8e8e8;

    .input {
      flex: 1;
      margin-right: 12px;
      resize: none;
    }

    .sendButton {
      height: 38px;
      width: 38px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
